Skip to content

Fsharp tests#2626

Draft
licon4812 wants to merge 17 commits into
thomhurst:mainfrom
licon4812:fsharp-tests
Draft

Fsharp tests#2626
licon4812 wants to merge 17 commits into
thomhurst:mainfrom
licon4812:fsharp-tests

Conversation

@licon4812
Copy link
Copy Markdown
Contributor

This pull request introduces F# support to the solution by adding F# unit tests and updating project references and dependencies accordingly. The main changes include the addition of a new F# test project, updates to the solution and project files to integrate it, and the inclusion of necessary F#-related NuGet packages.

F# Support and Test Infrastructure:

  • Added a new F# test project ModularPipelines.UnitTests.FSharp to the solution, providing F#-based unit tests for API surface and attribute event invocation. (ModularPipelines.sln, test/ModularPipelines.UnitTests.FSharp/Api/FlexibleDependencyApiExportTests.fs, test/ModularPipelines.UnitTests.FSharp/Attributes/AttributeEventInvokerTests.fs) [1] [2] [3] [4] [5]

  • Updated ModularPipelines.csproj to allow the new F# test project access to internal members via InternalsVisibleTo.

Dependency Management:

  • Added F#-related NuGet package dependencies: FSharp.Core and TUnit.Assertions.FSharp to Directory.Packages.props for F# test support. [1] [2]

Solution Configuration:

  • Updated the solution file to Visual Studio 2022 (v18) format and included the new F# test project in all build configurations. [1] [2]

These changes collectively enable writing and running F# unit tests alongside existing C# tests, improving test coverage and flexibility for the codebase.

Additional Notes

  • Not all tests pass at this stage. Most do
  • I had to comment out some tests in FlexibleDependencyIntegrationTests, due to the attribute DependsOnModulesWithAttribute being a generic typed attribute. Which unfortunatly FSharp does not support
  • I started the first 20 tests, then used copilot to generate the other 500 based on the csharp tests

licon4812 and others added 15 commits May 12, 2026 20:45
…idation, Requirements, Results, Modules) (#1)

* Convert C# Attributes unit tests to F#

Add F# equivalents for 13 test files in the Attributes folder:
- CliToolAttributeTests.fs
- DotNetFormatOptionsTests.fs
- DynamicDependencyIntegrationTests.fs
- EnumValueAttributeTests.fs
- LifecycleEventIntegrationTests.fs
- LinuxOnlyTestAttribute.fs
- MetadataCrossPhaseIntegrationTests.fs
- ModuleAttributeEventServiceTests.fs
- ModuleDependencyRegistryTests.fs
- ModuleMetadataRegistryTests.fs
- ModuleReadyEventTests.fs
- ModuleRegistrationContextTests.fs
- WindowsOnlyTestAttribute.fs

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: licon4812 <32421608+licon4812@users.noreply.github.com>

* Add F# unit test conversions for Models, State, Validation, Requirements, Results, Modules

Convert 18 C# unit test files to idiomatic F# equivalents in test/ModularPipelines.UnitTests.FSharp/:
- Models/: MyModel.fs, CommandLineTests.fs, JsonSerializationTests.fs, KeyValueTests.fs, RequirementDecisionTests.fs, SkipDecisionTests.fs, TrxParsingTests.fs
- State/: ModuleExecutionPhaseTests.fs, ModuleStateStoreTests.fs, ModuleStateTransitionsTests.fs
- Validation/: ValidationInterfaceTests.fs, ValidationTests.fs
- Requirements/: PipelineRequirementBaseClassTests.fs, RequireFactoryTests.fs
- Results/: ResultsRepositoryTests.fs, ReturnNothingTests.fs
- Modules/: SyncModuleTests.fs, TestModule1.fs
- Updated .fsproj with wildcard compile entries for all 6 new directories

Note: Build has remaining errors to fix (assertion extension methods, ModuleStateSnapshot required properties).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: licon4812 <32421608+licon4812@users.noreply.github.com>

* fix F# unit test build regressions

Agent-Logs-Url: https://github.com/licon4812/ModularPipelines/sessions/7e44fb1f-68fb-4d1a-93a9-59d8e808e306

Co-authored-by: licon4812 <32421608+licon4812@users.noreply.github.com>

* address F# test review follow-ups

Agent-Logs-Url: https://github.com/licon4812/ModularPipelines/sessions/7e44fb1f-68fb-4d1a-93a9-59d8e808e306

Co-authored-by: licon4812 <32421608+licon4812@users.noreply.github.com>

* tighten F# state test cleanup

Agent-Logs-Url: https://github.com/licon4812/ModularPipelines/sessions/7e44fb1f-68fb-4d1a-93a9-59d8e808e306

Co-authored-by: licon4812 <32421608+licon4812@users.noreply.github.com>

* finalize F# event handler cleanup

Agent-Logs-Url: https://github.com/licon4812/ModularPipelines/sessions/7e44fb1f-68fb-4d1a-93a9-59d8e808e306

Co-authored-by: licon4812 <32421608+licon4812@users.noreply.github.com>

* fix remaining F# attribute test build errors

Agent-Logs-Url: https://github.com/licon4812/ModularPipelines/sessions/c9451e79-96d6-4d20-91e7-5a00f713e05c

Co-authored-by: licon4812 <32421608+licon4812@users.noreply.github.com>

* normalize F# metadata event formatting

Agent-Logs-Url: https://github.com/licon4812/ModularPipelines/sessions/c9451e79-96d6-4d20-91e7-5a00f713e05c

Co-authored-by: licon4812 <32421608+licon4812@users.noreply.github.com>

* Update ResultsRepositoryTests.fs

* complete F# CliAttributeTests conversion

Agent-Logs-Url: https://github.com/licon4812/ModularPipelines/sessions/d613e767-c418-4b8e-b79b-44c5ebf97bcf

Co-authored-by: licon4812 <32421608+licon4812@users.noreply.github.com>

* guard mixed cli attribute ordering assertion

Agent-Logs-Url: https://github.com/licon4812/ModularPipelines/sessions/d613e767-c418-4b8e-b79b-44c5ebf97bcf

Co-authored-by: licon4812 <32421608+licon4812@users.noreply.github.com>

* avoid unsafe head access in cli attribute test

Agent-Logs-Url: https://github.com/licon4812/ModularPipelines/sessions/d613e767-c418-4b8e-b79b-44c5ebf97bcf

Co-authored-by: licon4812 <32421608+licon4812@users.noreply.github.com>

* Fixed FSharp Attribute tests namespace

* finish F# state and validation test conversions

Agent-Logs-Url: https://github.com/licon4812/ModularPipelines/sessions/34b9a83f-ebc5-4758-bdda-fe0ee0581f30

Co-authored-by: licon4812 <32421608+licon4812@users.noreply.github.com>

* return non-null result in self-referencing validation module

Agent-Logs-Url: https://github.com/licon4812/ModularPipelines/sessions/34b9a83f-ebc5-4758-bdda-fe0ee0581f30

Co-authored-by: licon4812 <32421608+licon4812@users.noreply.github.com>

---------

Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: licon4812 <32421608+licon4812@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: James Alickolli <jalickolli@gmail.com>
… test port fixes (#2)

* Generate F# wrappers for remaining unit tests

Agent-Logs-Url: https://github.com/licon4812/ModularPipelines/sessions/114fa639-5aec-4441-ae7b-fcb8805d5cf1

Co-authored-by: licon4812 <32421608+licon4812@users.noreply.github.com>

* Revert "Generate F# wrappers for remaining unit tests"

This reverts commit c67143b.

Co-authored-by: licon4812 <32421608+licon4812@users.noreply.github.com>

* WIP generated remaining F# test wrappers

Agent-Logs-Url: https://github.com/licon4812/ModularPipelines/sessions/114fa639-5aec-4441-ae7b-fcb8805d5cf1

Co-authored-by: licon4812 <32421608+licon4812@users.noreply.github.com>

* Remove wrapper infrastructure from F# test project

Agent-Logs-Url: https://github.com/licon4812/ModularPipelines/sessions/f3923578-41dc-4b47-a511-c38bd6c1a1e3

Co-authored-by: licon4812 <32421608+licon4812@users.noreply.github.com>

* Fix F# test project build regressions

Agent-Logs-Url: https://github.com/licon4812/ModularPipelines/sessions/ad0e9a0f-5d99-4bf8-af61-f7294d9e6656

Co-authored-by: licon4812 <32421608+licon4812@users.noreply.github.com>

* Restore native F# tests and fix many compile errors

Agent-Logs-Url: https://github.com/licon4812/ModularPipelines/sessions/4701a5ec-874f-499d-9b7c-13fd34d69e45

Co-authored-by: licon4812 <32421608+licon4812@users.noreply.github.com>

* Fixed build errors

* More build fixes

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: licon4812 <32421608+licon4812@users.noreply.github.com>
Co-authored-by: James Alickolli <jalickolli@gmail.com>
@codacy-production
Copy link
Copy Markdown

codacy-production Bot commented May 14, 2026

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity

Metric Results
Complexity 0 (≤ 20 complexity)

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@licon4812
Copy link
Copy Markdown
Contributor Author

Sorry, accidental click

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants